package cn.edu.gduf.luowowo.common.util;

import cn.edu.gduf.luowowo.common.exception.LogicException;

public abstract class Assert {

    public static void hasLength(String text,String msg){
        if (text == null || "".equals(text.trim())){
            throw new LogicException(msg);
        }
    }

    public static void equalsPasswords(String password, String rpassword) {
        if (password == null || rpassword == null){
            throw new LogicException("密码和确认密码不能为空");
        }
        if (!password.equals(rpassword)){
            throw new LogicException("两次密码输入不一致，请检查");
        }
    }
}
